<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>五角星</title>
    <style>
        canvas{
            background-color: red;
        }
    </style>
</head>
<body>
    <canvas width="400px" height="400px" id="canvas">
        版本太低会显示
    </canvas>
    <script>
        var myCanvas=document.getElementById("canvas");
        var ctx=myCanvas.getContext("2d");
        // ctx.fillStyle="#fff";
        // ctx.beginPath();
        // ctx.arc(200,200,100,(Math.PI/180)*270,(Math.PI/180)*90);
        // ctx.fill();

        ctx.fillStyle = "black";
        ctx.lineWidth="10px"
        ctx.beginPath();
        ctx.moveTo(70, 100);
        ctx.lineTo(330, 100);
        ctx.lineTo(100, 280);
        ctx.lineTo(200, 10);
        ctx.lineTo(300, 280);
        ctx.lineTo(70, 100);
        ctx.stroke();
    </script>
</body>
</html>